<template>
  <el-dialog
    width="30%"
    :title="params.title"
    :visible.sync="visible"
  >
    <el-form
      ref="form"
      label-width="80px"
      :model="formDatas"
    >
      <el-form-item label="提示信息:" label-width="80px">
        <el-input v-model="formDatas.desc" rows="10" type="textarea" />
      </el-form-item>
    </el-form>
    <span
      slot="footer"
      class="dialog-footer"
    >
      <el-button
        size="mini"
        @click="cancel"
      >取 消</el-button>
      <el-button
        size="mini"
        type="primary"
        @click="confirm"
      >确 定</el-button>
    </span>
  </el-dialog>
</template>
<script>
// import { addGroup, setGroup } from '@/api/agent'
export default {
  name: 'ReportAuditPro',
  props: {
    // eslint-disable-next-line vue/require-default-prop
    params: {
      type: Object
    },
    width: {
      type: String,
      default: '70%'
    }
  },
  data() {
    return {
      checked: false,
      visible: false,
      formData: {},
      //   表格数据
      formDatas: {
        desc: ''
      }
    }
  },
  methods: {
    open(ok) {
      this.formData = this._.cloneDeep(this.params)
      this.ok = ok
      this.visible = true
      this.formDatas.desc = ''
    },
    cancel() {
      this.visible = false
    },
    confirm() {
      if (this.formDatas.desc === '') {
        this.$message({
          message: '请输入备注',
          type: 'warning'
        })
      } else {
        this.ok({ desc: this.formDatas.desc })
        this.visible = false
      }
    }
  }
}
</script>
